<?php

namespace App\Http\Controllers\YApi;

//use Illuminate\Http\Request;
use Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;

use Session;
use Redirect;

use App\Models\Book;
use App\Models\BooksPingfen;

class GetReadStateController extends Controller
{

    public function getreadstate()
    {
		//获得读书的状态 1想读 2在读 3读过
		$bookid = request::input('bookid');
		$uid = request::input('uid');

		$bookspingfen = BooksPingfen::where('book_id', $bookid)->where('uid', $uid)->first();
		if($bookspingfen == null)
		{
			// 书籍没有评分
			return 1;
			
		}
		else {
			// 书籍有评分
			return $bookspingfen;
		}
    }
    
}